<?php $this->load->view('head');?>
<script type="text/javascript" src="<?=__THEMES__?>js/thickbox.js"></script>
<style type="text/css">
	.detail_tr{height:30px; line-height:30px; text-align:center;}
</style>
<!--content start-->
<div id="bagu-content">
    <?php if(!empty($member)):?>
    <table width="100%" cellpadding="0" cellspacing="0" align="center" style="border:1px dashed #CCC; font-size:14px;">
    	<tr class="detail_tr">
        	<td>客户类型:</td>
            <td><?=$member['type']?></td>
            <td>客户账号:</td>
            <td><?=$member['account']?></td>
        </tr>
        <tr class="detail_tr">
        	<td>姓名:</td>
            <td><?=$member['name']?></td>
            <td>性别:</td>
            <td><?=$member['sex']==1?'男':'女'?></td>
        </tr>
        <tr class="detail_tr">
        	<td>联系方式:</td>
            <td><?=$member['mobile']?></td>
            <td>E-Mail:</td>
            <td><?=$member['email']?></td>
        </tr>
        <tr class="detail_tr">
        	<td>QQ号码:</td>
            <td><?=$member['qq']?></td>
            <td>生日习俗:</td>
            <td><?=$member['habitude']==0?'阳历':'阴历';?></td>
        </tr>
        <tr class="detail_tr">
        	<td>阳历生日:</td>
            <td><?=$member['lyear'].'-'.$member['lbirthday']?></td>
            <td>阴历生日:</td>
            <td><?=$member['syear'].'-'.$member['sbirthday']?></td>
        </tr>
        <tr class="detail_tr">
        	<td>入库时间:</td>
            <td><?=date('Y-m-d',$member['datetime'])?></td>
            <td>入库人:</td>
            <td><?=$member['operator']?></td>
        </tr>
        <tr class="detail_tr">
        	<td>联系地址:</td>
            <td colspan="3"><?=$member['address']?></td>
        </tr>
        <?php if(!empty($member['others'])):?>
         <tr class="detail_tr">
        	<td>其他信息:</td>
            <td colspan="3"><?=$member['others']?></td>
        </tr>      	
        <?php endif;?>
    </table>
    <?php else:?>
    	没有此人信息
    <?php endif;?>
    <div>
		<br />
    </div>
    <?php if(!empty($orders['data'])):?>
		<table cellpadding="0" cellspacing="0" align="center" width="100%" style="border:1px dashed #CCC;font-size:14px;">
            <tr class="list_header" style="display:block; width:100%;height:25px; line-height:25px;">
                <th style="width:50px; text-align:center;">排序</span>
                <th style="width:110px; text-align:center;">售出店铺</th>
                <th style="width:80px; text-align:center;">快递方式</th>
                <th style="width:110px; text-align:center;">快递单号</th>
                <th style="width:70px; text-align:center;">收件人</th>
                <th style="width:120px; text-align:center;">联系方式</th>
                <th style="width:200px; text-align:center;">收件地址</th>
                <th style="width:70px; text-align:center;">礼物</th>
                <th style="width:100px; text-align:center;">客户要求</th>
                <th style="width:70px; text-align:center;">发货状态</th>
                <th style="width:70px; text-align:center;">客户评价</th>
                <th style="width:70px; text-align:center;">详情</th>
            </tr>
            <?php foreach($orders['data'] as $key=>$val):?>
            <tr id="order_<?=$key+1?>" style="display:block; width:100%;border-top:#CCC 1px dashed;">
            	<td style="width:50px; text-align:center"><?=$key+1?></td>
                <td style="width:110px; text-align:center"><?=$val['shopname']?></td>
                <td style="width:80px; text-align:center;"><?=$val['name']?></td>
                <td style="width:110px; text-align:center;"><!--<a href="javascript:check_ship_number('<?=$val['oid']?>','<?=$val['shipnumber']?>','<?=$val['short']?>')"><?=$val['shipnumber']?></a>-->
                <a href="<?=site_url('order/check_ship_detail').'/'.$val['shipnumber'].'/'.$val['short']?>"><?=$val['shipnumber']?></a>
                </td>
                <td style="width:70px; text-align:center;"><?=$val['reciver']?></td>
                <td style="width:120px; text-align:center;"><?=$val['phone']?></td>
                <td style="width:200px; text-align:center;"><?=$val['reciveaddress']?></td>
                <td style="width:70px; text-align:center;"><?=$val['gift']?></td>
                <td style="width:100px; text-align:center;"><?=$val['request']?></td>
                <td style="width:70px; text-align:center;">
					<?php 
                    	switch($val['status'])
						{
							case 0: echo '<font color="#FF3300">未发货</font>';break;
							case 1: echo '已发货';break;
							case 2: echo '已签收';break;
							case 3: echo '<font color="#FF0000">已退货</font>';break;
						}
                    ?>
                </td>
                <td style="width:70px; text-align:center;">
                	<?php 
						switch($val['comment'])
						{
							case 0: echo '未评价';break;
							case 1: echo '好评';break;
							case 2: echo '<font color="#FF0000">中评</font>';break;
							case 3: echo '<font color="#FF0000">已退货</font>';break;
						}
					?>
                </td>
                <td style="width:70px; text-align:center;">
                	<!--<a  href="<?=site_url('member/order_detail').'/'.$val['oid']?>?keepThis=true&TB_iframe=true&height=200&width=500" title="" class="thickbox">查看详细</a>-->
                    <a  href="javascript:check_order_detail('<?=$val['oid']?>')" >查看详细</a
                ></td>
            </tr>
            <?php endforeach;?>
            </table>
    <?php endif?>
     <?=!empty($orders['html'])?$orders['html']:''?>
</div>
<!--content end-->	
<?php $this->load->view('footer');?>
<script type="text/javascript">
	var id = '';
	//查看订单详细
	function check_order_detail(oid)
	{
		var order_list = $('.order_list').length;
		if(order_list)
		{
			$('.order_list').remove();
		}
		var ship_detail = $('.ship_detail').length;
		if(ship_detail)
		{
			$('.ship_detail').remove();
		}
		if(id==oid)
		{
			id='';
		}
		else
		{
			$.post('<?=site_url('order/order_detail')?>',{oid:oid},function(data){
				if(data=='noorders')
				{
					alert('没有订单信息!');
				}
				else
				{
					id = oid;
					$('#order_'+oid).append(data);
				}
			});
		}
	}
/*	//查看快递单详细
	var shipid = '';
	function check_ship_number(oid,shipnumber,shiptype)
	{
		var ship_detail = $('.ship_detail').length;
		if(ship_detail)
		{
			$('.ship_detail').remove();
		}
		var order_list = $('.order_list').length;
		if(order_list)
		{
			$('.order_list').remove();
		}
		if(shipid==oid)
		{
			shipid = '';
		}
		else
		{
			$.ajax({
				type: "POST",
				url: "<?=site_url('order/check_ship_detail')?>",
				data:{oid:oid,shipnumber:shipnumber,shiptype:shiptype},
				success: function(data)
				{
					if(data=="failed")
					{
						alert('获取数据失败,请稍候再试!');
					}
					else if(data=="inexistence")
					{
						alert('单号数据不存在,请检查!');
					}
					else
					{
						shipid = oid;
						$('#order_'+oid).append(data);
					}
				}
			});
		}
	}*/
</script>